﻿using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;

namespace Language.Syntax.Colouring.Formats
{
    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Comment )]
    [Name( Classification.Name.Comment )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Comment : ClassificationFormatDefinition
    {
        public Comment()
        {
            // Unfortunately, for whatever reason, the [DisplayName] attribute doesn't appear to work so the property must be set inside the constructor
            DisplayName = "Red Scripts Comment";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.LiteralInteger )]
    [Name( Classification.Name.LiteralInteger )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class LiteralInteger : ClassificationFormatDefinition
    {
        public LiteralInteger()
        {
            DisplayName = "Red Scripts Integer";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.LiteralFloat )]
    [Name( Classification.Name.LiteralFloat )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class LiteralFloat : ClassificationFormatDefinition
    {
        public LiteralFloat()
        {
            DisplayName = "Red Scripts Float";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.LiteralString )]
    [Name( Classification.Name.LiteralString )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class LiteralString : ClassificationFormatDefinition
    {
        public LiteralString()
        {
            DisplayName = "Red Scripts String";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.LiteralName )]
    [Name( Classification.Name.LiteralName )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class LiteralName : ClassificationFormatDefinition
    {
        public LiteralName()
        {
            DisplayName = "Red Scripts Name";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Keyword )]
    [Name( Classification.Name.Keyword )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Keyword : ClassificationFormatDefinition
    {
        public Keyword()
        {
            DisplayName = "Red Scripts Keyword";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Integral )]
    [Name( Classification.Name.Integral )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Integral : ClassificationFormatDefinition
    {
        public Integral()
        {
            DisplayName = "Red Scripts Integral Type";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.ActionGotoDef )]
    [Name( Classification.Name.ActionGotoDef )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class ActionGotoDef : ClassificationFormatDefinition
    {
        public ActionGotoDef()
        {
            DisplayName = "Red Scripts Goto Definition Highlight";
            TextDecorations = System.Windows.TextDecorations.Underline;
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Native )]
    [Name( Classification.Name.Native )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Imported : ClassificationFormatDefinition
    {
        public Imported()
        {
            DisplayName = "Red Scripts Imported (Global)";

            IsItalic = true;
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Class )]
    [Name( Classification.Name.Class )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Class : ClassificationFormatDefinition
    {
        public Class()
        {
            DisplayName = "Red Scripts Class";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.NativeClass )]
    [Name( Classification.Name.NativeClass )]
    [UserVisible( false )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class NativeClass : ClassificationFormatDefinition
    {
        public NativeClass()
        {
            DisplayName = "Red Scripts Native Class";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Function )]
    [Name( Classification.Name.Function )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Function : ClassificationFormatDefinition
    {
        public Function()
        {
            DisplayName = "Red Scripts Function";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.MethodCall )]
    [Name( Classification.Name.MethodCall )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class MethodCall : ClassificationFormatDefinition
    {
        public MethodCall()
        {
            DisplayName = "Red Scripts Method Call";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.NativeMethodCall )]
    [Name( Classification.Name.NativeMethodCall )]
    [UserVisible( false )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class NativeMethodCall : ClassificationFormatDefinition
    {
        public NativeMethodCall()
        {
            DisplayName = "Red Scripts Native Method Call";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.FunctionCall )]
    [Name( Classification.Name.FunctionCall )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class FunctionCall : ClassificationFormatDefinition
    {
        public FunctionCall()
        {
            DisplayName = "Red Scripts Function Call";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.NativeFunctionCall )]
    [Name( Classification.Name.NativeFunctionCall )]
    [UserVisible( false )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class NativeFunctionCall : ClassificationFormatDefinition
    {
        public NativeFunctionCall()
        {
            DisplayName = "Red Scripts Native Function Call";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Identifier )]
    [Name( Classification.Name.Identifier )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Identifier : ClassificationFormatDefinition
    {
        public Identifier()
        {
            DisplayName = "Red Scripts Identifier";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Local )]
    [Name( Classification.Name.Local )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Local : ClassificationFormatDefinition
    {
        public Local()
        {
            DisplayName = "Red Scripts Local";
            IsBold = true;
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Parameter )]
    [Name( Classification.Name.Parameter )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Parameter : ClassificationFormatDefinition
    {
        public Parameter()
        {
            DisplayName = "Red Scripts Parameter";
            IsBold = true;
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Member )]
    [Name( Classification.Name.Member )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Member : ClassificationFormatDefinition
    {
        public Member()
        {
            DisplayName = "Red Scripts Member Variable";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.Enum )]
    [Name( Classification.Name.Enum )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class Enum : ClassificationFormatDefinition
    {
        public Enum()
        {
            DisplayName = "Red Scripts Enum";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.EnumOption )]
    [Name( Classification.Name.EnumOption )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class EnumOption : ClassificationFormatDefinition
    {
        public EnumOption()
        {
            DisplayName = "Red Scripts Enum Option";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.NativeEnum )]
    [Name( Classification.Name.NativeEnum )]
    [UserVisible( false )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class NativeEnum : ClassificationFormatDefinition
    {
        public NativeEnum()
        {
            DisplayName = "Red Scripts Native Enum";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [ClassificationType( ClassificationTypeNames = Classification.Name.NativeEnumOption )]
    [Name( Classification.Name.NativeEnumOption )]
    [UserVisible( false )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class NativeEnumOption : ClassificationFormatDefinition
    {
        public NativeEnumOption()
        {
            DisplayName = "Red Scripts Native Enum Option";
        }
    }

    [Export( typeof( EditorFormatDefinition ) )]
    [Name( Classification.Name.DynamicHighlightWord )]
    [UserVisible( true )]
    [Order( After = Priority.Default, Before = Priority.High )]
    internal sealed class HighlightWord : ClassificationFormatDefinition
    {
        public HighlightWord()
        {
            DisplayName = "Red Scripts highlight word";
        }
    }
}
